home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Sample Code / Snippets / OS Utilities / TestGestalt / TestVM / TestGestalt.c < prev   
Encoding:
C/C++ Source or Header  |  1992-07-15  |  662 b   |  45 lines  |  [TEXT/MPS ]

  1. #ifndef __CTYPE__
  2. #include <CType.h>
  3. #endif
  4.  
  5. #ifndef __OSUTILS__
  6. #include <OSUtils.h>
  7. #endif
  8.  
  9. #ifndef __STDIO__
  10. #include <StdIO.h>
  11. #endif
  12.  
  13. #ifndef __GESTALTEQU__
  14. #include <GestaltEqu.h>
  15. #endif
  16.  
  17. #ifndef __TYPES__
  18. #include <Types.h>
  19. #endif
  20.  
  21. #define    TRUE            0xFF
  22. #define    FALSE            0
  23.  
  24. #define Gestalttest            0xA1AD
  25. #define NoTrap            0xA89F
  26.  
  27. main()
  28. {
  29. OSErr        err;
  30. long        feature;
  31.  
  32. if ((GetTrapAddress(Gestalttest) != GetTrapAddress(NoTrap))) {
  33.     err = Gestalt(gestaltVMAttr, &feature);
  34.     if (!err) {
  35.         if (feature & 0x0001)
  36.             printf ("We have VM\n");
  37.         else
  38.             printf ("We don't have VM\n");
  39.         }
  40.     else 
  41.         printf ("Gestalt err = %i\n",err);
  42.     }
  43. else
  44.     printf ("No Gestalt\n");
  45. }